package Demo1;

/**
 * Created with Interllij IDEA.
 * Descriptiption:
 * User: 王澄慧
 * Date: 2022-04-09
 * Time: 10:28
 */

//final
abstract class Sharp{  //final不能修饰抽象类
    public abstract void draw();
}

abstract class A extends Sharp{  //一个抽象类继承一个抽象类，不需要重写方法
    public/*private / final*/abstract void func(); //final 不能修饰抽象方法 不能是private
}
class Cycle extends Sharp {
    @Override
    public void draw() {
        System.out.println("○");
    }
}
class B extends A{
    @Override
    public void draw() {

    }

    @Override
    public void func() {

    } //这时候需要把所有的抽象类的方法重写

}
/*class Cycle extends Sharp {
    @Override
    public void draw() {
        System.out.println("○");
    }
}
class Rect extends Sharp {
    @Override
    public void draw() {
        System.out.println("◆");
    }
}
class San extends Sharp {
    @Override
    public void draw() {
        System.out.println("△");
    }
}
class Flalor extends Sharp {
    @Override
    public void draw() {
        System.out.println("花");
    }
}*/
public class TestDemo3 {

    /*public static void drawMar(){
        Cycle cycle = new Cycle();
        Rect rect = new Rect();
        San san = new San();
        Flalor flalor = new Flalor();
        Sharp[] sharps = {cycle,rect,cycle,rect,flalor,san};
        for (Sharp sharp:sharps) {
            sharp.draw();
        }
    }

    public static void main(String[] args) {
        drawMar();
    }*/

}

